{extends file="../global.html"}
{block name=body}
<style type="text/css">
	.layui-form-item{ width: 90% }

</style>
	<form class="layui-form" action="{url('run/Goods/update')}" method="post" enctype="multipart/form-data">
	  <div class="layui-form-item">
	    <label class="layui-form-label">商品名称</label>
	    <div class="layui-input-block">
	      <input type="text" name="goods_name" required  lay-verify="required" value="{$res.goods_name}" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  <input type="hidden" name="goods_id" value="{$res.goods_id}">
	   <input type="hidden" name="pic" value="{$res.goods_pic}">
	    <input type="hidden" name="pictures" value="{$res.goods_pictures}">
	  <div class="layui-form-item">
	    <label class="layui-form-label">所属品牌</label>
	    <div class="layui-input-block">
	      <select disabled name="type_id" lay-verify="required">

	        <option value=""></option>
	        {foreach $type as $k=>$v}

	        <option value="{$v['type_id']}"  {if $res.type_id == $v.type_id} selected  {/if}>{$v['type_name']}</option>
			{/foreach}
	        
	      </select>
	    </div>
	  </div>
	  <div class="layui-form-item">
		   <label class="layui-form-label">商品封面图片</label>

		  <input type="file" name="file" id="imgPicker" style="width:15%;background:#6E6266">

		  <img id="preview" width="100" src="{$absroot}{$res.goods_pic}"/>
  	</div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">厂商指导价(万)</label>
	    <div class="layui-input-block">
	      <input type="number" step="0.01" name="goods_price" required  lay-verify="required" value="{$res.goods_price}" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	   <div class="layui-form-item">
	    <label class="layui-form-label">款型年份</label>
	    <div class="layui-input-block">
	      <input type="text" name="goods_model" required class="Wdate layui-input" onFocus="WdatePicker({ lang:'zh-cn',dateFmt:'yyyy'})" style="background:#4D4447;" lay-verify="required" value="{$res.goods_model}" autocomplete="off" class="layui-input">
	    </div>
	  </div>


	     <div class="layui-form-item">
	    <label class="layui-form-label">排量(T/L)</label>
	    <div class="layui-input-block">
	      <input type="text" name="goods_describe" required  lay-verify="required" value="{$res.goods_describe}" autocomplete="off" class="layui-input">
	    </div>
	  </div>

		  <div class="layui-form-item">
	    <label class="layui-form-label">商品配置信息</label>
	    <div class="layui-input-block">
	      <input type="text" name="goods_car" required  lay-verify="required" value="{$res.goods_car}" autocomplete="off" class="layui-input">
	    </div>
	  </div>


	    <div class="layui-form-item">
	    <label class="layui-form-label">车身结构</label>
	    <div class="layui-input-block">
	      <select disabled name="goods_model_car" lay-verify="required">

	        <option value="微小型车" {if $res.goods_model_car == '微小型车'} selected {/if}>微小型车</option>
	        <option value="紧凑型车" {if $res.goods_model_car == '紧凑型车'} selected {/if}>紧凑型车</option>
	        <option value="中型车" {if $res.goods_model_car == '中型车'} selected {/if}>中型车</option>
	        <option value="中大型车" {if $res.goods_model_car == '中大型车'} selected {/if}>中大型车</option>
	        <option value="SUV" {if $res.goods_model_car == 'SUV'}selected {/if}>SUV</option>
	        <option value="MPV" {if $res.goods_model_car == 'MPV'}selected {/if}>MPV</option>
	        <option value="跑车" {if $res.goods_model_car == '跑车'}selected {/if}>跑车</option>
	      </select>
	    </div>
	  </div>
	
	  <div class="layui-form-item">
	    <label class="layui-form-label">首付(万)</label>
	    <div class="layui-input-block">
	      <input type="number" step="0.01" name="goods_payment" required  lay-verify="required" value="{$res.goods_payment}" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	   <div class="layui-form-item">
	    <label class="layui-form-label">月供(元)</label>
	    <div class="layui-input-block">
	      <input type="number" name="goods_month" required  lay-verify="required" value="{$res.goods_month}"  autocomplete="off" class="layui-input">
	    </div>
	  </div>
	
	  <div class="layui-form-item">
	    <label class="layui-form-label">尾款购车(元)</label>
	    <div class="layui-input-block">
	      <input type="number" name="goods_retainage" required  lay-verify="required" value="{$res.goods_retainage}" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	 <!--   <div class="layui-form-item">
		  <label class="layui-form-label">图册</label>

		  
<input id = "input-b3" name = "input-b3[]" type = "file" class ="file" multiple data-show-upload = "false" data-show-caption = "true" >  
  	 </div> -->
<div class="container-fluid">
<div class="row" style="">
	<label class="form-label col-xs-4 col-sm-2">多图预览上传</label>
	<div class="col-md-6  col-xs-8 col-sm-9">
	<div style="width:935px;height: 277px;overflow: hidden;margin-left: -80px;border: 1px solid #ccc;border-radius: 4px;">
    {foreach $pic as $value}
	<img src="{$absroot}{$value} " width="50"/>
	{/foreach}
	</div class="col-md-12">
		<input name="goods_pictures[]" id="file-0a" class="file" type="file" multiple data-min-file-count="0" style="width: 769px" />
	</div>
</div>
</div>
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	  <button class="layui-btn" id="btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	 </div>
	 
	</form>
	<!--   <script type="text/javascript" src="{$absroot}static/run/js/webuploader.js"></script>
	   <link  type="text/css" rel="stylesheet" href="{$absroot}static/run/css/uploadify.css"/> -->



	<script type="text/javascript">
//初始化fileinput控件（第一次初始化）
$("#file-0").fileinput({
   
        allowedFileExtensions : ['jpg', 'png','gif'],//接收的文件后缀
      
    });
 	pic();
 	
	</script>
      

{/block}
 
